perf: cache session history with workspace images#20733
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
API preview: https://pr-20733-api.vm6.ai |
Code Review: PR #20733SummaryReviewed the runner/guest session-history sidecar cache implementation across 5 commits. The sidecar is modeled as an optional workspace-image-cache optimization, not as a new source of truth. The code validates metadata identity and body file identity before use, verifies hash/size before restore, accounts sidecar bytes in cache GC/inspection, and falls back to remote session history on cache failure. Key FindingsCritical Issues (P0)None found. High Priority (P1)None found. Testing ReviewCoverage
Convention ComplianceNo testing convention violations found. Rust tests use real temp directories/filesystem operations, Testing Verdict: AdequateBad Smell Analysis
VerificationReviewed and ran: git diff --check origin/main...HEAD
cargo test --manifest-path crates/Cargo.toml -p runner session_history_sidecar -- --nocapture
cargo test --manifest-path crates/Cargo.toml -p runner workspace_sidecar -- --nocapture
cargo test --manifest-path crates/Cargo.toml -p runner codex_zstd_sidecar -- --nocapture
cargo clippy --manifest-path crates/Cargo.toml -p runner -p guest-agent --all-targets -- -D warnings
cargo fmt --manifest-path crates/Cargo.toml --all -- --checkAll passed. RecommendationsNo changes requested. VerdictLGTM. Full review details: |
Summary
guest-contracts, cap sidecars at the current 64 MiB copy-file stream limit, and include sidecar bytes in cache GC/inspection accountingTesting
cargo test --manifest-path crates/Cargo.toml -p guest-agent session_history_identity -- --nocapturecargo test --manifest-path crates/Cargo.toml -p runner session_history_sidecar -- --nocapturecargo test --manifest-path crates/Cargo.toml -p runner restore_plan_ -- --nocapturecargo test --manifest-path crates/Cargo.toml -p runner run_in_sandbox_restores_session_history_from_workspace_sidecar -- --nocapturecargo test --manifest-path crates/Cargo.toml -p runner workspace_promotion::tests -- --nocapturecargo check --manifest-path crates/Cargo.toml -p guest-agent -p runnercargo clippy --manifest-path crates/Cargo.toml -p guest-agent -p runner --all-targets -- -D warningsCloses #20732